// *****************************
// * Raamatukogu - Example Story  *
// *****************************
// items.lua

local ITEM

--------------------------------------------------------------------------------------------------------------
-- Medkit
--------------------------------------------------------------------------------------------------------------

	ITEM = {}

	ITEM.Classname = "medkit"
	ITEM.Printname = "Medical Kit"

	ITEM.Description = "Heals 35 health."
	ITEM.Author = "thomasfn"

	ITEM.Weight = 0.5
	ITEM.Model = "items/healthKit.mdl"

	ITEM.Mins = Vector( -3.6, -7.3, -0.2 )
	ITEM.Maxs = Vector( 14.2, 7.4, 6.1 )

	ITEM.CanPickup = true
	ITEM.CanDrop = true
	ITEM.DropOnDeath = true
	ITEM.CanUse = true

	function ITEM:OnUse()
		local ply = self.Owner
		if (ValidEntity( ply )) then
			ply:SetHealth( math.Clamp( ply:Health() + 35, 0, 100 ) )
		end
		self:Destroy()
	end

	gstore.LoadFactoryFromTable( ITEM )

--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------
-- Crowbar
--------------------------------------------------------------------------------------------------------------

	ITEM = {}

	ITEM.Classname = "crowbar"
	ITEM.Printname = "Crow Bar"

	ITEM.Description = "Used for wacking stuff"
	ITEM.Author = "rebecca"

	ITEM.Weight = 2
	ITEM.Model = "weapons/w_crowbar.mdl"

	ITEM.Mins = Vector( -3.6, -7.3, -0.2 )
	ITEM.Maxs = Vector( 14.2, 7.4, 6.1 )

	ITEM.CanPickup = true
	ITEM.CanDrop = true
	ITEM.DropOnDeath = true
	ITEM.CanUse = true

	function ITEM:OnUse()
		local ply = self.Owner
		if (ValidEntity( ply )) then
			ply:Give("weapon_crowbar")
		end
		self:Destroy()
	end

	gstore.LoadFactoryFromTable( ITEM )

--------------------------------------------------------------------------------------------------------------

	
--------------------------------------------------------------------------------------------------------------
-- Crate
--------------------------------------------------------------------------------------------------------------

	ITEM = {}

	ITEM.Base = "base_container"

	ITEM.Classname = "crate"
	ITEM.Printname = "Storage Crate"

	ITEM.Description = "Stores items."
	ITEM.Author = "thomasfn"

	ITEM.Weight = 0.5
	ITEM.Model = "items/item_item_crate.mdl"

	ITEM.Mins = Vector( -15.3, -17.3, -0.3 )
	ITEM.Maxs = Vector( 17.3, 15.3, 24.3 )

	ITEM.CanPickup = true
	ITEM.CanDrop = true
	ITEM.DropOnDeath = true
	ITEM.CanUse = true
	
	gstore.LoadFactoryFromTable( ITEM )

--------------------------------------------------------------------------------------------------------------